<?php
require 'lib/init.php';
$conn=mConn();
$cat_id=mGetOne('select cat_id from article where art_id='.$_GET['id']);
$sql="delete from article where art_id=$_GET[id];";
mQuery($sql);
if(mysqli_affected_rows($conn)>0){
    mQuery("update cat set num=num-1 where cat_id=$cat_id;");
    success('文章删除成功');
}else{
    if(mysqli_errno($conn)){
        mLog($sql.mysqli_error($conn));
        error("删除失败");
        exit();
    }else{
        error('被删除文章的id不存在');
    }
}
